package Class9_2;

public class Work3 {
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSchlool() {
        return schlool;
    }

    public void setSchlool(String schlool) {
        this.schlool = schlool;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private String schlool;
    private String name;
    public void introduce(){
        System.out.println("自我介绍");
    }
    public void shangke(){
        System.out.println("上课");
    }
    public void show(){
        System.out.println("姓名"+name+"学校"+schlool+"年龄"+age);
    }
    public void a(int age)throws Exception{
        if (age>22){
            this.age=age;
        }else {
            throw new Exception("年龄太小");
        }
    }
}
